<template>
    <div>
        <van-grid :gutter="10">
            <van-grid-item v-for="value in goodsList" :key="value.id" 
                :to='{name:"goodsinfo",params:{id:value.id}}'>
                <img :src="value.pic" alt="">
                <h5>{{value.title}}</h5>
            </van-grid-item>
        </van-grid>
    </div>
</template>
<script>
// @ is an alias to /src
import {getGoodsList} from '@/api/product'
import {mapState} from 'vuex'
export default {
    name: 'CLASSIFY',
    data() {
        return {
        
        }
    },
    created() {
        getGoodsList()
        // console.log('classify')
    },
    destroyed() {
        
        console.log('classify')
    },
    computed: {
        ...mapState(['goodsList'])
    },
    components: {
        
    }
}
</script>
<style lang="less">
    img{
        width: 100%;
        height: auto;
    }
</style>